var fs = require('fs')
function read (path) {
  fs.readFile(path, (err, data) => {
    return data.toString()
  })
}
console.log(read('../foo.txt')) // undefined

// 嵌套 - 回调地狱
function read_1 (path1, path2, path3) {
  fs.readFile(path1, (err, data) => {
    console.log(data.toString())
    fs.readFile(path2, (err, data) => {
      console.log(data.toString())
      fs.readFile(path3, (err, data) => {
        console.log(data.toString())
      })
    })
  })
}
read_1('../foo.txt', '../baz.txt', '../bar.txt')